<extend name="Public/Common/base.html" />
<block name="main">
<css href="__PUBLIC__/assets/css/tp.css" />
<style>
.am-table{
	font-size:13px;
}
</style>
<table class="am-table am-table-compact am-table-centered am-scrollable-horizontal   am-table-bordered">
    <thead>
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>邮箱</th>
            <th>手机</th>
            <th>性别</th>
            <th>工作岗位</th>
            <th>工资</th>
            <th>有无社保</th>
            <th>入职时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
    <volist name="stafflist" id="vo">
        <tr>
            <td>{$i}</td>
            <td>{$vo.name}</td>
            <td>{$vo.email}</td>
            <td>{$vo.phone}</td>
            <td><if condition="$vo.sex eq 1">男<else/>女</if></td>
            <td>{$vo.station}</td> 
            <td>{$vo.salary}</td>
            <td>
            <if condition="$vo.social eq 0">无<else/>
            {$vo.social}
            </if>
            </td>  
            <td>          
            {$vo.time}
            </td> 
               
            <td>
            <a href="{:U('Staff/edit?id='.$vo['id'])}">
            <button class="am-btn am-btn-primary am-btn-xs ">编辑</button>
            </a>
            <a onclick='return del("{$vo.id}")'>
            <button  class="am-btn am-btn-warning am-btn-xs }">删除</button>
            </a>           
            </td>
        </tr>
       </volist>
    </tbody>
</table>
		 <div class="am-g am-text-center">
		      {$page}
			</div>
	<div class="am-g">
       <a href="{:U('Staff/add')}">
           <button class="am-btn am-btn-primary am-btn-sm ">{$info}</button>
        </a>
	</div>
 
<js href="__PUBLIC__/layer/layer.js" />
<script type="text/javascript">
function del(id){
	layer.confirm('您确定要删除这条数据吗？', {
	btn: ['确定','取消']
	}, function()
	{
	$.ajax({
	url: "__MODULE__/Staff/delete",
	type: "get",
	data:{"id":id},
	dataType: "json",
	beforeSend:function(){
		layer.msg('正在删除', {
			  icon: 16
			  ,shade: 0.01
			});
	},
	success: function(data){
	if(data.state==1){
	location.href = location.href;
	layer.msg(data.msg, {icon: 6});
	}else{
	layer.msg(data.msg, {icon: 5});
	}
	},
	error:function(){
		layer.msg('服务异常！');
	}
	
	});


	});
	}
	

</script> 	 
        
      
</block>
